<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Android调用 JS 代码demo</title>

    <style type="text/css">
			body {
				background-color: red
			}

			.btn {
				background: #cccccc;
				line-height: 50px;
				margin: 10px
			}
		</style>


</head>
<body>
<h2>WebView</h2>
<div><span>请输入要传递的值：</span><input type="text" id="input"></div>
<div id="btn"><span class="btn">点我</span></div>
<script type="text/javascript">
			var btn = document.getElementById("btn")
			var input = document.getElementById("input")
			btn.addEventListener("click", function() {
				var str = input.value;
				if(document.javaScriptInterface){
					javaScriptInterface.setValue(str) ;
				}else{
					alert("javaScriptInterface not found") ;
				}
			})
			var remote = function(str){
				input.value = str ;
			}

		</script>
</body>
</html>
